1 REM LIFE EXPECTANCY SEPT 1979 2 REM 3 REM ANDY GAMPLE COLUMBIA COLLEGE 4 REM 1619 W 10 AVE VANCOUVER BC 5 REM 6 REM FROM 'PUBLIC DOMAIN',MSE,SVP 7 REM 8 REM COMPUTES LIFE EXPECTANCY 9 REM PET 8K 10 REM ADAPTED FROM CREATIVE COMPUTING 11 REM BOOK 2 12 REM"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174] [221][160] SAN MATEO COUNTY [160][221] 13 [143]"(null) OFFICE OF EDUCATION (null) (null) & (null) 14 REM"[221] COMPUTER-USING EDUCATORS [221] [221] SOFTSWAP [221] 15 [143]"(null) (null) (null) (null) 16 REM"[221]333 MAIN STREET, REDWOOD CITY[221] [221]CA 94063 (415)364-5600 EX4401[221] 17 [143]"/TANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANEXP ORTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTAN^ 18 REM"[221] PROGRAMS MAY BE COPIED FOR [221] [221] EDUSATIONAL USE ONLY AND [221] 19 [143]"(null) ARE NOT TO BE SOLD. (null) /TANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANTANEXP 150 PRINTCHR$(147);" LIFE EXPECTANCY":PRINT:PRINT:PRINT 160 RESTORE 170 PRINT"THIS IS A TEST TO PREDICT HOW LONG YOU'LL LIVE. "; 180 PRINT"I'LL ASK YOU A SERIES OF SHORT QUESTIONS, "; 190 PRINT"WHICH YOU WILL ANSWER BY PRESSING THE APPROPRIATE KEY.":PRINT 200 PRINT" DO NOT PRESS RETURN" 210 PRINT:PRINT:PRINT 220 R5=1 230 Z=72:A$="ABCDEMGHIJKLFNO" 240 GOTO1440 250 R5=R5+1 260 IFR5>21THEN1620 270 DATA"++++++++++SEX+++++++++++" 280 DATA"ARE YOU MALE OR FEMALE?" 290 DATA"M=MALE" 300 DATA" F=FEMALE" 310 DATA2,"MF" 320 DATA"+++++++LIFE STYLE++++++++++" 330 DATA"WHERE DO YOU LIVE?" 340 DATA"G=CITY OVER 2 MILLION" 350 DATA"K=TOWN UNDER 10 000, OR A FARM" 360 DATA" I=NEITHER" 370 DATA3,"GKI" 380 DATA"+++HOW DO YOU WORK?+++" 390 DATA"M=DESK WORK" 400 DATA"L=HEAVY PHYSICAL LABOUR" 410 DATA" I=NEITHER" 420 DATA3,"MLI" 430 DATA"HOW LONG DO YOU EXERCISE STRENUOUSLY:" 440 DATA"(TENNIS, RUNNING, ETC)?" 450 DATA"F=5TIMES A WEEK FOR AT LEAST HALF AN HOUR" 460 DATA"K=2 OR 3 TIMES A WEEK" 470 DATA" I=NEITHER" 480 DATA3,"FKI" 490 DATA"+++WHO DO YOU LIVE WITH?+++" 500 DATA"N=SPOUSE,FRIEND OR FAMILY" 510 DATA"H=LIVED ALONE FOR 1-10 YEARS" 520 DATA"G=LIVED ALONE FOR 11-20 YEARS" 530 DATA"M=LIVED ALONE FOR 21-30 YEARS" 540 DATA"E=LIVED ALONE FOR 31-40 YEARS" 550 DATA" D=LIVED ALONE FOR MORE THAN 40 YEARS" 560 DATA6,"NHGMED" 570 DATA"++++++++PSYCHE++++++++++" 580 DATA"DO YOU SLEEP MORE THAN 10 HOURS A NIGHT?" 590 DATA"I=NO" 600 DATA" E=YES" 610 DATA2,"IE" 620 DATA"++++++MENTAL STATE+++++++" 630 DATA"M=IF YOU ARE INTENSE,AGGRESSIVE OR EASILY ANGERED" 640 DATA"L=IF YOU ARE EASY-GOING, RELAXED OR A FOLLOWER" 650 DATA" I=NEITHER" 660 DATA3,"MLI" 670 DATA"++++++HOW YOU FEEL++++++++" 680 DATA"ARE YOU HAPPY OR UNHAPPY?" 690 DATA"J=HAPPY" 700 DATA"G=UNHAPPY" 710 DATA" I=NEITHER" 720 DATA3,"JGI" 730 DATA"++++++FACTORS+++++++" 740 DATA"HAVE YOU HAD A SPEEDING TICKET IN THE LAST YEAR?" 750 DATA"H=YES" 760 DATA" I=NO" 770 DATA2,"HI" 780 DATA"++++++INCOME++++++" 790 DATA"DO YOU EARN MORE THAN $50 000 A YEAR?" 800 DATA"G=YES" 810 DATA" I=NO" 820 DATA2,"GI" 830 DATA"++++++SCHOOLING++++++" 840 DATA"J=FINISHED COLLEGE" 850 DATA"L=GRADUATE OR PROFESSIONAL DEGREE" 860 DATA" I=NEITHER" 870 DATA3,"JLI" 880 DATA"++++++++AGE++++++++++" 890 DATA"ARE YOU 65 OR OLDER AND STILL WORKING?" 900 DATA"L=YES" 910 DATA" I=NO" 920 DATA2,"LI" 930 DATA"+++++++HEREDITY++++++++" 940 DATA"K=IF ANY GRANDPARENTS LIVED TO 85 YEARS OLD" 950 DATA"O=IF ALL GRANDPARENTS LIVED TO 80 YEARS OLD" 960 DATA" I=NEITHER" 970 DATA3,"KOI" 980 DATA"HAS ANY PARENT DIED OF A STROKE" 990 DATA"OR HEART ATTACK BEFORE THE AGE OF 50?" 1000 DATA"E=YES" 1010 DATA" I=NO" 1020 DATA2,"EI" 1030 DATA"+++FAMILY DISEASES+++" 1040 DATA"ANY PARENT, BROTHER OR SISTER UNDER 5 HAS (OR HAD):" 1050 DATA"CANCER, A HEART CONDITION OR DIABETES SINCE CHILDHOOD?" 1060 DATA"M=YES" 1070 DATA" I=NO" 1080 DATA2,"MI" 1090 DATA"+++++HEALTH+++++" 1100 DATA"HOW MUCH TOBACCO DO YOU SMOKE?" 1110 DATA"A=MORE THAN 2 PACKS A DAY" 1120 DATA"C=1 TO 2 PACKS A DAY" 1130 DATA"M=ONE HALF TO ONE PACK A DAY" 1140 DATA" I=DON'T SMOKE" 1150 DATA4,"ACMI" 1160 DATA"++++++DRINK+++++++" 1170 DATA"DO YOU DRINK THE EQUIVALENT OF A " 1180 DATA"QUARTER BOTTLE OF LIQUOR A DAY?" 1190 DATA"H=YES" 1200 DATA" I=NO" 1210 DATA2,"HI" 1220 DATA"+;++++WEIGHT++++++" 1230 DATA"A=OVERWEIGHT BY 50 POUNDS OR MORE" 1240 DATA"E=OVER BY 30-50 POUNDS" 1250 DATA"G=OVER BY 10-30 POUNDS" 1260 DATA" I=NOT OVERWEIGHT" 1270 DATA4,"AEGI" 1280 DATA"++++++CHECK-UPS+++++++" 1290 DATA"IF A MALE OVER 40: DO YOU HAVE AN ANNUAL CHECK-UP?" 1300 DATA"K=YES" 1310 DATA" I=NO OR NOT A MALE OR UNDER 40 YEARS OLD" 1320 DATA2,"KI" 1330 DATA"IF A WOMAN: DO YOU SEE A GYNECOLOGIST ONCE A YEAR?" 1340 DATA"K=YES" 1350 DATA" I=NO OR NOT A WOMAN" 1360 DATA2,"KI" 1370 DATA"++++++CURRENT AGE++++++" 1380 DATA"I=UNDER 30" 1390 DATA"K=BETWEEN 30 AND 40 YEARS OLD" 1400 DATA"L=BETWEEN 40 AND 50 YEARS OLD" 1410 DATA"F=BETWEEN 50 AND 70 YEARS OLD" 1420 DATA" N=OVER 70" 1430 DATA5,"KLFNI" 1440 READQ$:PRINTQ$:PRINT 1450 FORQ=2TO7:READQ$ 1460 IFLEFT$(Q$,1)=" "THEN1490 1470 PRINT" ";Q$ 1480 NEXTQ 1490 PRINT" ";Q$:READC,C$ 1500 PRINT:PRINT"CHOOSE ONE OF THE LETTERS ABOVE"; 1510 GETG$:IFG$=""THEN1510 1520 PRINTG$ 1530 FORC2=1TOC 1540 IFLEFT$(G$,1)=MID$(C$,C2,1)THEN1570 1550 NEXTC2 1560 GOTO1500 1570 PRINTCHR$(147):PRINT:PRINT 1580 FORN=1TO15 1590 IFLEFT$(G$,1)=MID$(A$,N,1)THEN1610 1600 NEXT 1610 M=N-9:Z=Z+M:GOTO250 1620 PRINT:PRINT:PRINT"YOU ARE EXPECTED TO LIVE TO THE AGE OF "Z" YEARS." 1630 IFZ<60THEN1700 1640 FORY=60TOZSTEP5 1650 READM$,F$ 1660 NEXTY 1670 DATA"26%","15%","36%","20%","48%","30%","61%","39%" 1680 DATA"75%","53%","87%","70%","96%","88%","99.9%","99.6%" 1690 PRINT"OUT-LIVING "M$" OF THE MEN AND "F$" OF THE WOMEN." 1700 FORI=1TO9:GETAA$:NEXTI 1710 PRINT:PRINT:PRINT"ANOTHER RUN (Y/N)?"; 1720 GETAA$:IFAA$=""THEN1720 1730 PRINTAA$:IFAA$="Y"THEN110 1740 END